#!/bin/bash
#
#
set -e

nrpe_version="2.12"

cd /usr/local/src/
archive_nrpe="nrpe-$nrpe_version.tar.gz"
if [ ! -f $archive_nrpe ]
then
	wget http://download.tech-max.fr/nagios/$archive_nrpe
fi

tar xvzf $archive_nrpe
cd nrpe-$nrpe_version/
./configure --enable-ssl --with-ssl 
make all
make install
cp init-script.debian /etc/init.d/nrpe
chmod a+rx /etc/init.d/nrpe
cp sample-config/nrpe.cfg /usr/local/nagios/etc/